package lab01;

/**
 * Created by Administrator on 2017/10/9.
 */
import java.util.Random;
import java.util.Scanner;
public class Text08 {
    public static void main(String[] args) {
        int a = new Random().nextInt(100) + 1;
        Scanner scanner = new Scanner(System.in);
        int b = 0;
        do{
        System.out.print("从1-100中猜一个数吧：");
        b = scanner.nextInt();

        if( b>a){
            System.out.println("猜大了!");
        }else if(b<a){
            System.out.println("猜小了!");
        }
    }while(b!=a);

  System.out.println("猜对了" +a);
}
}
